﻿using IotContract.Dtos.Clients.Equips;
using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IotContract.Dtos.Servers;
/// <summary>
/// 设备grpc通信dto
/// </summary>
[ProtoContract]
[ProtoInclude(20, typeof(HbcSiemensEquipDto))]
[ProtoInclude(21, typeof(BcrEquipDto))]
[ProtoInclude(23, typeof(HkOcvFmtEquipDto))]
[ProtoInclude(24, typeof(HkSelEquipDto))]
[ProtoInclude(25, typeof(SiemensS7EquipDto))]
[ProtoInclude(26, typeof(ApiEquipDto))]
[ProtoInclude(27,typeof(LgHkEquipDto))]
[ProtoInclude(28, typeof(LgNetEquipDto))]
public  class IotEquipDto
{
    /// <summary>
    /// 设备名称
    /// </summary>
    [ProtoMember(1)]
    public string Name { get; set; }

    /// <summary>
    /// 设备分组
    /// </summary>
    [ProtoMember(2)]
    public long GroupId { get; set; }

    /// <summary>
    /// 所属程序Id
    /// </summary>
    [ProtoMember(3)]
    public long ProgramId { get; set; }

    /// <summary>
    /// IP端口地址
    /// </summary>
    [ProtoMember(4)]
    public string IPAddress { get; set; }

    /// <summary>
    /// 是否启用
    /// </summary>
    [ProtoMember(5)]
    public int IsEnable { get; set; }

    /// <summary>
    /// 编号
    /// </summary>
    [ProtoMember(6)]
    public string Num { get; set; }

    /// <summary>
    /// 轮询时间;轮询时间毫秒
    /// </summary>
    [ProtoMember(7)]
    public int Pooling { get; set; }

    /// <summary>
    /// 设备类型
    /// </summary>
    [ProtoMember(8)]
    public string EquipType { get; set; }

   
    /// <summary>
    /// 解析方向
    /// </summary>
    [ProtoMember(9)]
    public string ReadDirection { get; set; }

    /// <summary>
    /// 备注;备注
    /// </summary>
    [ProtoMember(10)]
    public string Remark { get; set; }

    [ProtoMember(11)]
    public long Id { get; set; }
    /// <summary>
    /// 排序号
    /// </summary>
    [ProtoMember(12)]
    public int OrderNum { get; set; }
    /// <summary>
    /// 绑定单元号
    /// </summary>
    [ProtoMember(13)]
    public string UnitNum { get; set; }

    /// <summary>
    /// 协议
    /// </summary>
    [ProtoMember(14)]
    public string ProtobufType { get; set; }
    /// <summary>
    /// 绑定号
    /// </summary>
    [ProtoMember(15)]
    public string BindNum { get; set; }
    /// <summary>
    /// 程序类型
    /// </summary>
    [ProtoMember(16)]
    public int ProgramType { get; set; }


    /// <summary>
    /// 设备备用值
    /// </summary>
    public string Value { get; set; }

    /// <summary>
    /// 读取时间
    /// </summary>
    public DateTime? ReadTime { get; set; }

   

    public override string ToString()
    {
        return $"IotEquip Name:{Name},Num:{Num}";

    }
}
